﻿@model System.Linq.IOrderedQueryable<KRM.Core.vViewCurrentTask>
<div class="rdm-scroll" id="currenttask-scroll">
                        <table class="table table-bordered table-fix krmtable" data-height="450">
                            <thead>
                                <tr>
                                    <th>Priority</th>
                                    <th>Status</th>
                                    <th>Action</th>
                                    <th>TaskID</th>
                                    <th>Started Date</th>
                                    <th>OrderRef</th>
                                    <th>Name</th>
                                    <th>Title</th>
                                    <th>Task Description</th>
                                    <th>Assigned To</th>
                                    <th>Assigned Date</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (var item in Model)
                                {
                                    <tr id="currenttask_@(item.TaskID)" class="@(ViewBag.SelectedTaskId==item.TaskID?"row-task-selected":"")">
                                        @if (item.PriorityID == 1)
                                        {
                                            <td style='background: red; color: white'>Urgent</td>
                                        }
                                        else if (item.PriorityID == 2)
                                        {
                                            <td style='background: rgb(240, 103, 127); color: white'>High</td>
                                        }
                                        else if (item.PriorityID == 3)
                                        {
                                            <td style='background: #999; color: white'>Normal</td>
                                        }
                                        else if (item.PriorityID == 4)
                                        {
                                            <td style='background: blue; color: white'>Low</td>
                                        }
                                        else
                                        {
                                            <td></td>
                                        }
                                        @if (item.StatusID == 1)
                                        {
                                            <td style='background: LightBlue; color: white'>Unassigned</td>
                                        }
                                        else if (item.StatusID == 2)
                                        {
                                            <td style='background: #FFC97C; color: white'>Assigned</td>
                                        }
                                        else if (item.StatusID == 3)
                                        {
                                            <td style='background: green; color: white'>Started</td>
                                        }
                                        else if (item.StatusID == 4)
                                        {
                                            <td style='background: #f89406; color: white'>On Hold</td>
                                        }
                                        else if (item.StatusID == 5)
                                        {
                                            <td style='background: #62c462; color: white'>Completed</td>
                                        }
                                        else
                                        {
                                            <td></td>
                                        }
                                        <td><a href="javascript:;" onclick="PopupCenter('/orderview/viewtask/@item.TaskID?orderref=@item.ValueRef', 600, 540)" title="View Task">View task</a></td>
                                        <td>@item.TaskID</td>
                                        <td>@item.StartedDate</td>
                                        <td><a href="/orderview/orderdetail?OrderRef=@item.ValueRef" target="blank" style="cursor: pointer" title="View Order">@item.ValueRef</a></td>
                                        <td>@item.ValueName</td>
                                        <td>@item.TaskTitle</td>
                                        <td title="@item.TaskDescription">@item.TaskDescription</td>
                                        <td>@item.AssignedToUserName</td>
                                        <td>@item.AssignedDate</td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
